# 基础数据类型注解
wis_1:int = 10
wis_2:str = "g"
wis_3:bool = False

# 类对象类型注解
class Apple:
    pass
fruit:Apple = Apple()

# 基础容器类型注解
wis_4:list = [1,2,3]
wis_5:tuple = (1,"w",True)
wis_6:dict = {"a":1,"b":6,"c":3}

# 容器类型详细注解
wis_7:list[int|str|bool] = [10,"h",True]
wis_8:list[int] = [10,23,9]   # 中括号里可用一种类型总结涵盖这个列表中的数据类型
wis_9:tuple[int,str,float] = (56,"h",12.14)  # 对元组容器进行类型注解时必须注解所有元素的数据类型
wis_10:dict[str,str] = {"g":"d","s":"n"}
import random
wis_11 = random.randint(1,12) # type:int  # type:数据类型 注解方法
import json
wis_12 = json.loads('{"a":1,"b":2,"c":3}')  # type:dict  # 一般只有在无法一眼看出返回值数据类型时才会使用类型注解
def func():
    return 10
wis_14 = func() # type:int
wis_13 = 13 # type:bool  # 注解仅仅为提示作用，注解错误也不会报错，不会影响代码运行